package com.xiliu.server.modules.wxmsg.service.impl;

import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xiliu.server.modules.wxmsg.mapper.XlWxPublicInfoMapper;
import com.xiliu.server.modules.wxmsg.entity.XlWxPublicInfo;
import com.xiliu.server.modules.wxmsg.service.IXlWxPublicInfoService;

/**
 * 微信公众平台账号信息表Service业务层处理
 * 
 * @author xiliu
 * @date 2023-01-13
 */
@Service
public class XlWxPublicInfoServiceImpl extends ServiceImpl<XlWxPublicInfoMapper, XlWxPublicInfo> implements IXlWxPublicInfoService {
    @Autowired
    private XlWxPublicInfoMapper xlWxPublicInfoMapper;

    /**
     * 查询微信公众平台账号信息表
     * @param infoId 微信公众平台账号信息表主键
     * @return 微信公众平台账号信息表
     */
    @Override
    public XlWxPublicInfo selectXlWxPublicInfoByInfoId(Long infoId) {
        return xlWxPublicInfoMapper.selectXlWxPublicInfoByInfoId(infoId);
    }

    /**
     * 查询微信公众平台账号信息表列表
     * @param xlWxPublicInfo 微信公众平台账号信息表
     * @return 微信公众平台账号信息表
     */
    @Override
    public List<XlWxPublicInfo> selectXlWxPublicInfoList(XlWxPublicInfo xlWxPublicInfo) {
        return xlWxPublicInfoMapper.selectXlWxPublicInfoList(xlWxPublicInfo);
    }

    /**
     * 新增微信公众平台账号信息表
     * @param xlWxPublicInfo 微信公众平台账号信息表
     * @return 结果
     */
    @Override
    public boolean create(XlWxPublicInfo xlWxPublicInfo) {
        return save(xlWxPublicInfo);
    }

    /**
     * 修改微信公众平台账号信息表
     * @param xlWxPublicInfo 微信公众平台账号信息表
     * @return 结果
     */
    @Override
    public boolean update(XlWxPublicInfo xlWxPublicInfo) {
        return updateById(xlWxPublicInfo);
    }

    /**
     * 批量删除微信公众平台账号信息表
     * @param infoIds 需要删除的微信公众平台账号信息表主键
     * @return 结果
     */
    @Override
    public int deleteXlWxPublicInfoByInfoIds(Long[] infoIds) {
        return xlWxPublicInfoMapper.deleteBatchIds(Arrays.asList(infoIds));
    }

    /**
     * 删除微信公众平台账号信息表信息
     * @param infoId 微信公众平台账号信息表主键
     * @return 结果
     */
    @Override
    public int deleteXlWxPublicInfoByInfoId(Long infoId) {
        return xlWxPublicInfoMapper.deleteById(infoId);
    }
}
